import { cafReq } from "..";
// import { QueryParams } from "../request";

// export const baseURL = `${import.meta.env.VITE_REQ_URL}:30008`;
export const baseURL = `${import.meta.env.VITE_FIN_URL}`;

/**
 * 根据ID查询
 * @param {object} params PageParamTransactionProcessQuery
 * @param {number} params.pageIndex
 * @param {number} params.pageSize
 * @param {object} params.condition
 * @param {array} params.sorts
 * @returns
 */
export const aeoQuery = async (params: any) => {
  return await cafReq(0, { baseURL }).post(
    `/account-enter-and-exit/cost/transaction/process/v1/query`,
    params
  );
};

/**
 * 根据ID查询
 * @param {string} businessId 业务主键
 * @returns
 */
export const queryJournalByOperationId = async (
  operationId: number | string,
  params?: object
) => {
  return await cafReq(0, { baseURL }).get(
    `/account-enter-and-exit/cost/journal/entry/v1/getByOperationId/${operationId}`,
    { params }
  );
};
